package com.bsj.travel.mapper.mysql;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bsj.travel.def.common.DO.UserDO;
import com.bsj.travel.def.common.DTO.web.user.UserSearchDTO;
import com.bsj.travel.def.common.VO.UserVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/***
 * @description UserMapper
 * @author LiJiaXin
 * @version 1.0.0
 * @time 2024/1/10 11:27
 **/
@Repository
@DS("master")
public interface UserMapper extends BaseMapper<UserDO> {

    /**
     * 按指定条件统计数量
     *
     * @param userSearchDTO
     * @return java.lang.Integer
     * @author ljx
     * @time 2024/1/10 14:31
     */
    Integer countByCondition(@Param("userSearchDTO") UserSearchDTO userSearchDTO);

    /**
     * 根据用户名查询用户信息
     *
     * @param userName
     * @return com.bsj.travel.def.common.DO.UserDO
     * @author ljx
     * @time 2024/1/11 10:17
     */
    UserDO selectUserByUserName(@Param("cryptUserName") String userName);

    /**
     * 用户分页
     *
     * @param userSearchDTO
     * @return java.util.List<com.bsj.travel.def.common.VO.UserVO>
     * @author ljx
     * @time 2024/1/11 15:48
     */
    List<UserVO> selectUserPage(@Param("userSearchDTO") UserSearchDTO userSearchDTO, @Param("userIds") List<Integer> userIds);
}
